package NewCoder;

public class BM21 {
    public int minNumberInRotateArray(int [] array) {
        int i=0;
        int j=array.length-1;
        while(i<j){
            int mid=(j-i)/2+i;
            if(array[mid]>array[j]){
                i=mid+1;
            }else if(array[mid]<array[j]){
                j=mid;
            }else{
                j--;
            }
        }
        return array[i];
    }
}
